<template>
  <div class="we_component we_image">
    <div class="noimage" v-if="!data.url">
      <i class="icon icon-tupian"></i>
      <p style="margin-top:-10px;">请选择图片</p>
    </div>
    <a v-else-if="data.link" :href="`${data.link}?${Math.random()}`"><img :src="data.url" alt="" style="width: 100%;"></a>
    <a v-else><img :src="data.url" alt="" style="width: 100%;"></a>
    <div class="richText" v-html="data.richText" :style="{left:data.richTextX + 'px',top: data.richTextY + 'px'}"></div>
  </div>
</template>
<script>
  export default {
    props: ['data']
  }
</script>
<style lang="scss">
  .we_image{
    .noimage{padding-bottom:10px;text-align:center;line-height:1;color:#ccc;}
    .icon-tupian{font-size:100px;color:#ccc;}
  }
</style>
